//
//  CustomIdentifyPhoneNumberTextField.m
//  拉勾7.17
//
//  Created by dllo on 16/7/18.
//  Copyright © 2016年 YMJ. All rights reserved.
//

#import "CustomIdentifyPhoneNumberTextField.h"

@implementation CustomIdentifyPhoneNumberTextField

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
//控制显示文本的位置
- (CGRect)textRectForBounds:(CGRect)bounds {
    return CGRectMake(bounds.origin.x + 35, bounds.origin.y, bounds.size.width - 35, bounds.size.height);
}
//控制编辑文本的位置
- (CGRect)editingRectForBounds:(CGRect)bounds {
    return CGRectMake(bounds.origin.x + 35, bounds.origin.y, bounds.size.width - 35, bounds.size.height);
}
// 以上两个配合通常一起使用,记住一旦自定全部都要重写bounds指的是当前textField的位置坐标
//控制placeHolder的颜色、字体
- (void)drawPlaceholderInRect:(CGRect)rect {
    [[UIColor whiteColor] setFill];
    [self.placeholder drawInRect:CGRectMake(rect.origin.x, rect.size.height / 4, rect.size.width, rect.size.height) withAttributes:@{NSForegroundColorAttributeName:[UIColor lightGrayColor],NSFontAttributeName:[UIFont italicSystemFontOfSize:19]}];// 浅gay色
}
//控制左视图位置
- (CGRect)leftViewRectForBounds:(CGRect)bounds {
    return CGRectMake(bounds.origin.x, bounds.origin.y, 35, 53);

}
// 控制右视图位置
- (CGRect)rightViewRectForBounds:(CGRect)bounds {
    return CGRectMake(WIDTH - 20 - 150, bounds.origin.y, 150, 53);
}
@end
